<template lang="html">
    <div>
        <common-table :columns="columns" :data="data"/>
    </div>
</template>

<script>
import {
	getxhr
} from "@/apis/xhr";
import moment from "moment";
import CommonTable from '_c/CommonTable.vue'
export default {
    name: 'exceptionXHR',
    components: {
		CommonTable
	},
    data() {

        return {
            columns: [{
					title: 'method',
					key: 'method',
					width: '80'
				},
				{
					title: 'url',
					key: 'url',
					width: '400'
				},
				{
					title: 'async',
					key: 'async',
					width: '80'
				},
				{
					title: 'status',
					key: 'status',
					width: '80'
				},
				{
					title: 'response',
					key: 'response'
				},
				{
					title: 'timeLoad',
					key: 'timeLoad',
					width: '120'
				},
                {
                    title: '发生时间',
                    key: 'createTime',
                    width: '170'
                }
			],
            data: []
        }
    },
    mounted() {
        getxhr().then(res => {
            res.data.forEach(item => {
                item.createTime = moment(parseInt(item.createTime)).format("YYYY-MM-DD hh:mm:ss");
            })
            this.data = res.data;
        })
    }
}
</script>

<style lang="less" scoped>
</style>
